﻿[
    {
        $lookup: {
            from: "peoples",
            localField: "people",
            foreignField: "_id",
            as: "p"
        }
    },
    {
        $match: {
            clock_time: {
                $gte: new ISODate('@CalcStartTime'),
                $lte: new ISODate('@CalcEndTime')
            }
        }
    },
    {
        $unwind: "$p"
    },
    {
        $project: {
            "people_no": "$p.people_no",
            "people_name": "$p.people_name",
            "_id": 1,
            "card_source": 1,
            "clock_time": 1
        }
    }
]